<?php
/**
 * Abstract class for event managing
 * @author Kirill A Egorov kirill.a.egorov@gmail.com 
 * @copyright Copyright (C) 2012  Kirill A Egorov, 
 * DVelum project http://code.google.com/p/dvelum/ , http://dvelum.net
 * @license General Public License version 3
 */
abstract class Db_Object_Event_Manager{
	const BEFORE_ADD = 'onBeforeAdd';
	const BEFORE_UPDATE = 'onBeforeUpdate';
	const BEFORE_DELETE = 'onBeforeDelete';
	const AFTER_ADD = 'onAfterAdd';
	const AFTER_UPDATE = 'onBeforeUpdate';
	const AFTER_DELETE = 'onAfterDelete';
	
	/**
	 * Find and run event triggers
	 * Note that onBeforeDelete and onAfterDelete events provide "SpacialCase" empty Db_Object 
	 * id property exists
	 * @param string $code  (action constant)
	 * @param Db_Object $object
	 */
	abstract public function fireEvent($code , Db_Object $object);
}